package com.xiaoshuidi.cloud.module.rooms.iotfegin;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.xiaoshuidi.cloud.framework.common.exception.ServiceException;
import com.xiaoshuidi.cloud.framework.common.exception.enums.GlobalErrorCodeConstants;
import com.xiaoshuidi.cloud.framework.common.pojo.CommonResult;
import com.xiaoshuidi.cloud.framework.common.pojo.PageResult;
import com.xiaoshuidi.cloud.module.rooms.controller.admin.iot.vo.DeviceReaVo;
import com.xiaoshuidi.cloud.module.rooms.controller.admin.roomhouse.vo.DeviceListByNosReqVO;
import com.xiaoshuidi.cloud.module.rooms.enums.ErrorCodeConstants;
import org.springframework.cloud.openfeign.FallbackFactory;
/**
 * @BelongsProject: lease-module-rooms
 * @BelongsPackage: com.xiaoshuidi.cloud.module.rooms.iotfegin
 * @Author: James
 * @CreateTime: 2023-06-15  13:49
 * @Description: TODO
 * @Version: 1.0
 */
public class IotHystrixFallBackFactory implements FallbackFactory<IotDeviceFeginService> {
    @Override
    public IotDeviceFeginService create(Throwable cause) {
        return new IotDeviceFeginService(){

            @Override
            public String getDeviceList(DeviceListByNosReqVO deviceListByNosReqVO, Integer userId) {
                throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"调用iot服务异常");
            }
        };

    }
}
